package com.aixingfu.sports.view;

import com.aixingfu.sports.bean.Person;

import java.util.Comparator;

public class PinyinComparator implements Comparator<Person> {

    public int compare(Person o1, Person o2) {
        //这里主要是用来对ListView里面的数据根据ABCDEFG...来排序
        if (o1.getLetter().equals("#")) {
            return 1;
        } else if (o2.getLetter().equals("#")) {
            return -1;
        } else {
            return o1.getLetter().compareTo(o2.getLetter());
        }
    }
}
